trait Logger{
  def log(message:String):Unit={  
  }
}
class Calculator extends Logger{
  override def log(message:String):Unit={
    println(message)
  }
  def add(x:Int,y:Int):Int={
    val sum=x+y
    log(s"Adding $x and $y. Result: $sum")
    sum
  }
  def subtract(x:Int,y:Int):Int={
    val result=x*y
    log(s"Subtracting $x from $y. Result: $result")
    result
  }
}
val calculator=new Calculator()
calculator.add(10,5)
calculator.subtract(10,5)
